import React from 'react';
import ReactDOM from 'react-dom';
import {HashRouter as Router,Route} from 'react-router-dom';
import {createStore} from 'redux';
import {Provider} from 'react-redux';
import appReducer from './redux/reducer/index.js';
import App from './App.js';   
import * as serviceWorker from './serviceWorker';
//从引入静态组件app.js,变成引入动态组件app.js
const Root=()=>{                          
    return (
        <Router>  
            <Route path="/" component={App}></Route>
        </Router>
    )
};
let store=createStore(appReducer);

ReactDOM.render(
    <Provider store={store}>
        <Root/>
    </Provider>,
document.getElementById('root'));

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
